import {baseUrl} from './config.js'
		// url: `${baseUrl}/toplist/detail`,
export function toplist(){
	return new Promise(function(reslove,reject){
		uni.request({
			url: `${baseUrl}/toplist/detail`,
			method: 'GET',
			data: {},
			success: res => {
				reslove(res.data.list)
			},
			fail: () => {},
			complete: () => {}
		});
	})
		

}
export function list(id) {
	return uni.request({
		url: `${baseUrl}/playlist/detail?id=${id}`,
		
		method: 'GET',
		data: {},
		
	});
}
// 歌曲名称 封面
export function songDetail(id) {
	return uni.request({
		url: `${baseUrl}/song/detail?ids=${id}`,
		
		method: 'GET',
		data: {},
		
	});
}
//  相似歌曲
export function songSimi(id) {
	return uni.request({
		url: `${baseUrl}/simi/song?id=${id}`,
		
		method: 'GET',
		data: {},
		
	});
}
// 歌曲评论 /comment/music?id=186016&limit=1

  export function songComment(id) {
  	return uni.request({
  		url: `${baseUrl}/comment/music?id=${id}`,
  		
  		method: 'GET',
  		data: {},
  		
  	});
  }
  // 歌词 /lyric?id=33894312
  export function songLyric(id) {
  	return uni.request({
  		url: `${baseUrl}/lyric?id=${id}`,
  		
  		method: 'GET',
  		data: {},
  		
  	});
  }
  // 歌曲url /song/url?id=33894312 
  export function songUrl(id) {
  	return uni.request({
  		url: `${baseUrl}/song/url?id=${id}`,
  		
  		method: 'GET',
  		data: {},
  		
  	});
  }
  
  // 搜索
  // 热榜
  export function searchHot() {
  	return uni.request({
  		url: `${baseUrl}/search/hot/detail`,
  		
  		method: 'GET',
  		data: {},
  		
  	});
  }
  // 搜索/search?keywords= 海阔天空
  export function searchWord(key) {
  	return uni.request({
  		url: `${baseUrl}/search?keywords=${key}`,
  		
  		method: 'GET',
  		data: {},
  		
  	});
  }
  
  // 搜索建议 /search/suggest?keywords= 海阔天空
  export function search(key) {
  	return uni.request({
url: `${baseUrl}/cloudsearch?keywords=${key}`,
  		  		

  		method: 'GET',
  		data: {},
  		
  	});
  }